package com.seveneight.baijiesteward.ui.main.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.ShareImgBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.main.contract.ShareImgContract;
import com.seveneight.baijiesteward.ui.main.model.ShareImgModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/23.
 */

public class ShareImgPresenter implements ShareImgContract.ShareImgPresenter {

    ShareImgContract.ShareImgView shareImgView;
    ShareImgContract.ShareImgModel shareImgModel;
    public ShareImgPresenter( ShareImgContract.ShareImgView shareImgView){
        this.shareImgView=shareImgView;
        shareImgModel=new  ShareImgModel();
    }

    @Override
    public void getImgData(Context context, RequestBody body) {
        shareImgModel.getImgData(context,body, new MyCallBack<List<ShareImgBean>>() {
            @Override
            public void onSuccess(List<ShareImgBean> shareImgBeans) {
                shareImgView.reBackData(shareImgBeans);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
